<template>
  <div class="container">
    <h1>顶部加载栏</h1>
    <g-load :loaded="loaded"></g-load>
    <button @click="loaded=false">再显示一次</button>
  </div>
</template>
<script>
  import load from '../components/top-load'
  export default {
    components: {
      'g-load': load
    },
    data() {
      return {
        loaded: false
      }
    },
    watch: {
      loaded: function () {
        let that = this
        setTimeout(() => {
          this.loaded = true
        }, 3000);
      }
    },
    mounted: function () {
      let that = this
      setTimeout(() => {
        this.loaded = true
      }, 3000);
    }
  }

</script>
